package cn.com.api.mapper.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiU_coupon_detail;

//DAO
public interface U_coupon_detailMapperBase {

	// 根据id查看
	@Select("SELECT * FROM U_COUPON_DETAIL  WHERE COUPON_DETAIL_ID = #{coupon_detail_id}")
	public ApiU_coupon_detail findU_coupon_detailById(Integer coupon_detail_id);

	// 查看数据集
	@Select("SELECT * FROM U_coupon_detail")
	public List<ApiU_coupon_detail> findU_coupon_details();

	// 根据条件查看数据集
	public List<Map<String, Object>> findU_coupon_detailsByMap(HashMap condition);

	// 添加
	@Insert("INSERT INTO U_COUPON_DETAIL (COUPON_ID, ORDER_NO, USER_ID, USE_TIME, STATUS, IS_BALANCE, BALANCE_PRICE, BALANCE_TIME, COUPON_CODE, EXT1, EXT2, EXT3, EXT4, EXT5) VALUES (#{coupon_id}, #{order_no}, #{user_id}, #{use_time}, #{status}, #{is_balance}, #{balance_price}, #{balance_time}, #{coupon_code}, #{ext1}, #{ext2}, #{ext3}, #{ext4}, #{ext5})")
	@Options(useGeneratedKeys = true, keyProperty = "coupon_detail_id")
	public int insertU_coupon_detail(ApiU_coupon_detail u_coupon_detail);

	// 修改
	@Update("UPDATE U_COUPON_DETAIL SET COUPON_ID = #{coupon_id}, ORDER_NO = #{order_no}, USER_ID = #{user_id}, USE_TIME = #{use_time}, STATUS = #{status}, IS_BALANCE = #{is_balance}, BALANCE_PRICE = #{balance_price}, BALANCE_TIME = #{balance_time}, COUPON_CODE = #{coupon_code}, EXT1 = #{ext1}, EXT2 = #{ext2}, EXT3 = #{ext3}, EXT4 = #{ext4}, EXT5 = #{ext5} WHERE COUPON_DETAIL_ID = #{coupon_detail_id}")
	public int updateU_coupon_detail(ApiU_coupon_detail u_coupon_detail);

	// 删除
	@Delete("DELETE FROM U_COUPON_DETAIL  WHERE COUPON_DETAIL_ID = #{coupon_detail_id}")
	public int deleteU_coupon_detail(Integer coupon_detail_id);

	// Foreign keys revelant

	// region Indexs revelant

}
